home *** CD-ROM | disk | FTP | other *** search
- stop();
- score = 0;
- julspeed = 55;
- spider_julNum = 0;
- spidermove = 0;
- batmove = 0;
- v = 55;
- t = 0;
- tx = 0;
- gravitation = 30;
- tadd = 0.35;
- life = 0;
- endNum = 0;
- hitNum = 0;
- timeNum = 0.5;
- timewidth = time._width;
- julNum = 1;
- timecon = 0;
- live = 0;
- pressSounds = new Sound();
- pressSounds.attachSound("presssound");
- hitSounds = new Sound();
- hitSounds.attachSound("hitsound");
- deaths = new Sound();
- deaths.attachSound("death");
- julpoz.attachMovie("jul_spider","jul0",0);
- spider_randx = random(50) + 450;
- julpoz.jul0._x = spider_randx;
- julpoz.jul0.jul_speed = random(7) + 5;
- julpoz.attachMovie("jul_bat","jul" + julNum,julNum);
- bat_randx = random(50) + 150;
- julpoz["jul" + julNum]._x = bat_randx;
- julpoz.jul0.onEnterFrame = function()
- {
- spider_julNum += julpoz.jul0.jul_speed;
- this._rotation = julspeed * Math.cos(spider_julNum * 0.017453292519943295) + 90;
- if(spider_julNum > 360)
- {
- spider_julNum -= 360;
- }
- if(spidermove == 0)
- {
- spiderman._rotation = this._rotation;
- spidermanangle = spiderman._rotation;
- poz = new Object();
- poz.x = this.point._x;
- poz.y = this.point._y;
- this.localToGlobal(poz);
- spiderman._x = poz.x;
- spiderman._y = poz.y;
- spacepress = 0;
- }
- if(_root.spidermove == 2)
- {
- this._x += 5;
- }
- if(this._x > 750)
- {
- this.removeMovieClip();
- }
- };
- spiderman.onKeyDown = function()
- {
- if(Key.getCode() == 32)
- {
- if(spidermove == 0 & spacepress == 0)
- {
- pressSounds.start(0,1);
- if(spider_julNum > 180)
- {
- t = 0;
- tx = 0;
- spidermanstartx = this._x;
- spidermanstarty = this._y;
- jumpangle = 360 - spidermanangle - 90;
- spidermove = 1;
- this.gotoAndStop("jump");
- }
- else
- {
- t = 0;
- tx = 0;
- spidermanstartx = this._x;
- spidermanstarty = this._y;
- jumpangle = 360 - spidermanangle + 90;
- spidermove = 1;
- this.gotoAndStop("miss");
- }
- spacepress = 1;
- }
- if(spidermove == 2 & spacepress == 0)
- {
- pressSounds.start(0,1);
- if(_root.julpoz["jul" + (_root.julNum - 1)].bat_julNum > 180)
- {
- t = 0;
- tx = 0;
- spidermanstartx = this._x;
- spidermanstarty = this._y;
- jumpangle = 360 - spidermanangle - 90;
- spidermove = 1;
- this.gotoAndStop("jump");
- }
- else
- {
- t = 0;
- tx = 0;
- spidermanstartx = this._x;
- spidermanstarty = this._y;
- jumpangle = 360 - spidermanangle + 90;
- spidermove = 1;
- this.gotoAndStop("miss");
- }
- spacepress = 1;
- }
- }
- };
- Key.addListener(spiderman);
- spiderman.onEnterFrame = function()
- {
- if(spidermove == 1 && endNum == 0)
- {
- t += 0.25;
- tx += tadd;
- vy0 = v * Math.sin(jumpangle * 3.141592653589793 / 180);
- vx0 = v * Math.cos(jumpangle * 3.141592653589793 / 180);
- vy = vy0 - _root.gravitation * t;
- this._x = spidermanstartx + vx0 * tx;
- this._y = spidermanstarty - vy0 * t + 0.5 * _root.gravitation * t * t;
- this._rotation = Math.atan((- vy) / vx0) * 180 / 3.141592653589793;
- if(julpoz["jul" + julNum].hit.hitTest(this))
- {
- hitSounds.start(0,1);
- _root.julNum = _root.julNum + 1;
- spidermove = 2;
- timecon = 0;
- hitNum = 1;
- time._width = timewidth;
- score += 20;
- }
- }
- if(this._y >= 200 & live == 0)
- {
- deaths.start(0,1);
- live = 1;
- }
- if(this._y >= 400)
- {
- this._y = 400;
- life++;
- die.gotoAndPlay(2);
- if(life < 5)
- {
- eval("life" + life)._visible = 0;
- t = 0;
- tx = 0;
- timecon = 0;
- if(julNum <= 1)
- {
- spidermove = 0;
- }
- else
- {
- spidermove = 2;
- }
- time._width = timewidth;
- this.gotoAndStop("ready");
- live = 0;
- }
- if(life == 5)
- {
- eval("life" + life)._visible = 0;
- theend.gotoAndPlay(2);
- endNum = 1;
- }
- }
- };
- time.onEnterFrame = function()
- {
- if(this._width > timeNum & spidermove != 1)
- {
- this._width -= timeNum;
- }
- if(this._width <= timeNum && timecon == 0)
- {
- if(spider_julNum > 180)
- {
- t = 0;
- tx = 0;
- spidermanstartx = spiderman._x;
- spidermanstarty = spiderman._y;
- jumpangle = 360 - spidermanangle - 90;
- spidermove = 1;
- spiderman.gotoAndStop("jump");
- }
- else
- {
- t = 0;
- tx = 0;
- spidermanstartx = spiderman._x;
- spidermanstarty = spiderman._y;
- jumpangle = 360 - spidermanangle + 90;
- spidermove = 1;
- spiderman.gotoAndStop("miss");
- }
- if(spidermove == 2)
- {
- if(_root.julpoz["jul" + (_root.julNum - 1)].bat_julNum > 180)
- {
- t = 0;
- tx = 0;
- spidermanstartx = spiderman._x;
- spidermanstarty = spiderman._y;
- jumpangle = 360 - spidermanangle - 90;
- spidermove = 1;
- spiderman.gotoAndStop("jump");
- }
- else
- {
- t = 0;
- tx = 0;
- spidermanstartx = spiderman._x;
- spidermanstarty = spiderman._y;
- jumpangle = 360 - spidermanangle + 90;
- spidermove = 1;
- spiderman.gotoAndStop("miss");
- }
- }
- timecon = 1;
- }
- };
-